package com.person.providerpayment9001.service.impl;

import com.person.common.CommonResult;
import com.person.providerpayment9001.entity.Payment;
import com.person.providerpayment9001.mapper.PaymentMapper;
import com.person.providerpayment9001.service.PaymentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author zhangfc
 * @since 2021-05-13
 */
@Service
public class PaymentServiceImpl extends ServiceImpl<PaymentMapper, Payment> implements PaymentService {
    @Autowired
    private PaymentMapper paymentMapper;

    public CommonResult saveOne(Payment payment) {
        paymentMapper.insert(payment);
        return CommonResult.ok(200, "success", null);
    }

    public CommonResult findOne(int id,String port){
        Payment payment = paymentMapper.selectById(id);
        return CommonResult.ok(200,"success"+port,payment);
    }

    public CommonResult updateByid(Payment payment) {
        int result = paymentMapper.updateById(payment);
        return CommonResult.ok(200,"更新完成",result);
    }


}
